#coding=utf-8
'''
Created on 2016年7月8日
@author: Administrator
'''
import os
import time
import serial
import ConfigParser
import re
import serial  
import sys
import config
import logging_save
save_path = config.Basic_path()+'cli_wifi.txt'
sys.path.append(r'D:\eclipse\luyouqi\src')

import connect_cli
connect_cli.Connection()   #进行CLI配置

def check_is_connected():         #不同项目有不同的检查方式
    with open(save_path,'r') as ftest:
        #print ftest.readlines()
        #check_if_connected = re.findall("network is connected", ftest.readlines())
        #print ftest.readlines()
        for line in ftest.readlines():
                    
            if re.findall("network is connected", line):
                #return '213312321123132'

                return 'success'                         #返回OK则代表连接成长，退出循环操作
                break
            
            else:
                pass
                #return 'fail'
      
#print check_is_connected()